<!--- Variable for pre-process validation --->
<CFSET lPreProcessValidated="Yes">

<!--- check if eForms has pre-process prompt --->
<CFQUERY NAME="qryPrompt" DATASOURCE=#client.company_dsn#>
	SELECT PREPROCESSPROMPT,PREPROMPTMPLATE
	FROM ECRGFORMS
	WHERE FORMCODE = '#GetForm.FORMCODE#'
</CFQUERY>

<CFIF Trim(qryPrompt.PREPROCESSPROMPT) NEQ "" OR Trim(qryPrompt.PREPROMPTMPLATE) NEQ "">
	<CFIF Trim(GetForm.PREPROMPTTITLE) IS "">
		<CFSET sPreProcessTitle="Pre-process Prompt">
	<CFELSE>
		<CFSET sPreProcessTitle=GetForm.PREPROMPTTITLE>
	</CFIF>
	<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="#sPreProcessTitle#">
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
	<tr>
		<td><CFOUTPUT>#qryPrompt.PREPROCESSPROMPT#</CFOUTPUT></td>
	</tr>
	<CFSET lPreProcessShowMsg = "Yes">
	<CFIF FileExists("#GetDirectoryFromPath(GetCurrentTemplatePath())#..#application.fileseparator#pre_activities#application.fileseparator##qryPrompt.PREPROMPTMPLATE#")>
		 	<tr>
				<td><CFINCLUDE TEMPLATE="..\pre_activities\#qryPrompt.PREPROMPTMPLATE#"></td>
			</tr>
	   </CFIF>
	</table>
	<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
</CFIF>

<CFIF isDefined("GetEntry.ROUTEID")>
	<CFIF GetForm.PREPROCESS IS NOT "">
		<!--- Check if template is existing --->
		<CFIF FileExists("#GetDirectoryFromPath(GetCurrentTemplatePath())#..#application.fileseparator#pre_activities#application.fileseparator##GetForm.PREPROCESS#")>
			<CFSET lPreProcessValidated="No">

			<CFIF GetForm.PREPROCESSTITLE IS "">
				<CFSET sPreProcessTitle="Pre-process Activity">
			<CFELSE>
				<CFSET sPreProcessTitle=GetForm.PREPROCESSTITLE>
			</CFIF>
			<CFSET lPreProcessShowMsg = "Yes">
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="#sPreProcessTitle#" SHOW="True">
			<CFINCLUDE TEMPLATE="..\pre_activities\#GetForm.PREPROCESS#">
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
		</CFIF>
	</CFIF>
</CFIF>